<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <label>
      <button>按钮1</button>
      <button id="myButton">按钮2</button>
      <button>按钮3</button>
    </label>
    <script>
      // 获取一个按钮元素，其 id为 "myButton"，为其添加一个自定义属性 "data-status"，并设置其值为 "active"
      var a = document.getElementById("myButton");
      a.setAttribute("data-status", "active");
      console.log(a);
    </script>
  </body>
</html>
